package dao;

import com.javaweb.config.SpringConfig;
import com.javaweb.dao.TagDao;
import com.javaweb.model.Tag;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={SpringConfig.class})
public class tagtest {
    @Autowired
    private TagDao tagDao;

    //新增标签
    @Test
    public void testInsertTag(){
        Tag tag=new Tag().setId(1).setName("aa").setUpdateTime(new Date()).setCreateTime(new Date());
        tagDao.insert(tag);

    }
    @Test
    public void testUpdateTag(){
    tagDao.insertArticleTag(1, 2);
    }


}